//
//  UIButton+Category.swift
//  DSWeibo
//
//  Created by J on 16/4/24.
//  Copyright © 2016年 J. All rights reserved.
//

import UIKit
extension UIButton{
    
    ///快速创建UIButton
    class func createButton(image:String,title:String,font:CGFloat,titleColor:UIColor) -> UIButton{
        let btn = UIButton()
        btn.titleLabel?.font = UIFont.systemFontOfSize(font)
        btn.setTitleColor(titleColor, forState: UIControlState.Normal)
        btn.setImage(UIImage(named: image), forState: UIControlState.Normal)
        btn.setTitle(title, forState: UIControlState.Normal)
        btn.titleEdgeInsets = UIEdgeInsetsMake(0, 20, 0, 0)
        return btn
    }
    
}